xen/xen
xen/xen-syms
xen/xen.*
+Makefile.rej
rm -f config-host.mak config-host.h
rm -f keysym_adapter_sdl.h keysym_adapter_vnc.h
for d in $(TARGET_DIRS); do \
- rm -rf $$d || exit 1 ; \
+ $(MAKE) -C $$d $@ || exit 1 ; \
done
KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
clean:
rm -rf *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp qemu-vgaram-bin
+distclean:
+ rm -rf *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp qemu-vgaram-bin
+
install: all
if [ ! -d $(DESTDIR)$(bindir) ];then mkdir -p $(DESTDIR)$(bindir);fi
if [ ! -d $(DESTDIR)$(configdir) ];then mkdir -p $(DESTDIR)$(configdir);fi
#gdb --args /usr/sbin/qemu-dm -hda /var/images/qemu-linux.img -nographic \
# -serial pty -l 'ioport,int' $*
-while getopts ":f:" opt;
+# XXX this is a bit skanky. we assume an order of arguments here.
+# namely to have configfile and vncconnect argument as the first
+# two arguments.
+
+while getopts ":f:v:d:" opt;
do
case $opt in
- f) QEMUCONFIGFILE=$OPTARG;shift;shift;;
+ f) QEMUCONFIGFILE=$OPTARG;;
+ v) VNCCONNECT=$OPTARG;;
+ d) DOMAIN=$OPTARG;;
\?) echo;;
esac
done
+if [ "x$QEMUCONFIGFILE" != "x" ]; then shift; shift; fi
+if [ "x$VNCCONNECT" != "x" ]; then shift; shift; fi
+
echo $QEMUCONFIGFILE
if [ ! -z $QEMUCONFIGFILE ];then
elif [ $vnc -eq 1 ];then
PARMETER="$PARMETER -vnc -k en-us"
fi
+ VNCPORT=`expr 5900 + $DOMAIN`
+ PARMETER="$PARMETER -vncport $VNCPORT"
+ if [ "x$VNCCONNECT" != "x" ]; then
+ PARMETER="$PARMETER -vncconnect $VNCCONNECT"
+ fi
fi
#optional cmdline for qemu
static DisplayState display_state;
int nographic;
int usevnc; /* 1=vnc only, 2=vnc and sdl */
+long vncport; /* server port */
+const char* vncconnect; /* do a reverse connect to this host*/
const char* keyboard_layout = 0;
int64_t ticks_per_sec;
int boot_device = 'c';
"-m megs set virtual RAM size to megs MB [default=%d]\n"
"-nographic disable graphical output and redirect serial I/Os to console\n"
#ifdef CONFIG_VNC
- "-vnc use vnc instead of sdl\n"
+ "-vnc port use vnc instead of sdl\n"
+ "-vncport port use a different port\n"
+ "-vncconnect host:port do a reverse connect\n"
#ifdef CONFIG_SDL
"-vnc-and-sdl use vnc and sdl simultaneously\n"
#endif
QEMU_OPTION_nographic,
#ifdef CONFIG_VNC
QEMU_OPTION_vnc,
+ QEMU_OPTION_vncport,
+ QEMU_OPTION_vncconnect,
#ifdef CONFIG_SDL
QEMU_OPTION_vnc_and_sdl,
#endif
{ "nographic", 0, QEMU_OPTION_nographic },
#ifdef CONFIG_VNC
{ "vnc", 0, QEMU_OPTION_vnc },
+ { "vncport", HAS_ARG, QEMU_OPTION_vncport },
+ { "vncconnect", HAS_ARG, QEMU_OPTION_vncconnect },
#ifdef CONFIG_SDL
{ "vnc-and-sdl", 0, QEMU_OPTION_vnc_and_sdl },
#endif
snapshot = 0;
nographic = 0;
usevnc = 0;
+ vncport=0;
+ vncconnect=NULL;
kernel_filename = NULL;
kernel_cmdline = "";
has_cdrom = 1;
break;
#ifdef CONFIG_VNC
case QEMU_OPTION_vnc:
- usevnc = 1;
- break;
+ usevnc = 1;
+ break;
+ case QEMU_OPTION_vncport:
+ {
+ const char *p;
+ p = optarg;
+ vncport= strtol(optarg, (char **)&p, 0);
+ }
+ break;
+ case QEMU_OPTION_vncconnect:
+ {
+ vncconnect=optarg;
+ }
+ break;
#ifdef CONFIG_SDL
case QEMU_OPTION_vnc_and_sdl:
usevnc = 2;
} else {
if (usevnc) {
#ifdef CONFIG_VNC
- vnc_display_init(ds, (usevnc==2));
+ vnc_display_init(ds, (usevnc==2), vncport, vncconnect);
#else
perror("qemu not configured with vnc support");
#endif
void vga_screen_dump(const char *filename);
/* vnc.c */
-void vnc_display_init(DisplayState *ds, int useAlsoSDL);
+void vnc_display_init(DisplayState *ds, int useAlsoSDL,
+ long port, const char* connect);
/* cirrus_vga.c */
void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
+ *
+ *
+ * reverse connection setup copied from x11vnc.c
+ * Copyright (c) 2002-2005 Karl J. Runge <runge@karlrunge.com>
+ * All rights reserved.
+ * based on:
+ * the originial x11vnc.c in libvncserver (Johannes E. Schindelin)
+ * x0rfbserver, the original native X vnc server (Jens Wagner)
+ * krfb, the KDE desktopsharing project (Tim Jansen)
*/
#include "vl.h"
rfbScreenCleanup(screen);
}
-void vnc_display_init(DisplayState *ds, int useAlsoSDL)
+
+void vnc_display_init(DisplayState *ds, int useAlsoSDL,
+ long port, const char* connect)
{
+ int len, rport = 5500;
+ char host[1024];
+ char *p;
+ rfbClientPtr cl;
+
if(!keyboard_layout) {
fprintf(stderr, "No keyboard language specified\n");
exit(1);
exit(1);
}
+
mouse_magic=init_mouse_magic();
register_savevm("vnc", 0, 1, vnc_save, vnc_load, mouse_magic);
exit(1);
}
+
screen->serverFormat.redShift = 11;
screen->serverFormat.greenShift = 5;
screen->serverFormat.blueShift = 0;
screen->serverFormat.greenMax = 63;
screen->serverFormat.blueMax = 31;
+ if (port != 0)
+ screen->port = port;
+ else
+ screen->autoPort = TRUE;
+
if(useAlsoSDL) {
ds_sdl=(DisplayState*)malloc(sizeof(DisplayState));
sdl_display_init(ds_sdl,0);
ds->dpy_resize = vnc_resize;
ds->dpy_refresh = vnc_refresh;
+ /* deal with reverse connections */
+ if ( connect == NULL || (len = strlen(connect)) < 1) {
+ return;
+ }
+ if ( len > 1024 ) {
+ fprintf(stderr, "vnc reverse connect name too long\n");
+ exit(1);
+ }
+ strncpy(host, connect, len);
+ host[len] = '\0';
+ /* extract port, if any */
+ if ((p = strchr(host, ':')) != NULL) {
+ rport = atoi(p+1);
+ *p = '\0';
+ }
+ cl = rfbReverseConnection(screen, host, rport);
+ if (cl == NULL) {
+ fprintf(stderr, "reverse_connect: %s failed\n", connect);
+ } else {
+ fprintf(stderr, "reverse_connect: %s/%s OK\n", connect, cl->host);
+ }
+
atexit(vnc_cleanup);
+
+
+
}
if self.blkif_backend: flags |= SIF_BLK_BE_DOMAIN
#todo generalise this
if ostype == "vmx":
+ log.debug('building vmx domain')
err = buildfn(dom = dom,
image = kernel,
control_evtchn = 0,
ramdisk = ramdisk,
flags = flags)
else:
- log.warning('building dom with %d vcpus', self.vcpus)
+ log.debug('building dom with %d vcpus', self.vcpus)
err = buildfn(dom = dom,
image = kernel,
control_evtchn = self.channel.getRemotePort(),
memory = sxp.child_value(self.config, "memory")
# Create an event channel
device_channel = channel.eventChannel(0, self.dom)
+ # see if a vncviewer was specified
+ # XXX RN: bit of a hack. should unify this, maybe stick in config space
+ vncconnect=""
+ image = sxp.child_value(self.config, "image")
+ args = sxp.child_value(image, "args")
+ if args:
+ arg_list = string.split(args)
+ for arg in arg_list:
+ al = string.split(arg, '=')
+ if al[0] == "VNC_VIEWER":
+ vncconnect=" -v %s" % al[1]
+ break
+
# Execute device model.
#todo: Error handling
+ # XXX RN: note that the order of args matter!
os.system(device_model
+ " -f %s" % device_config
+ + vncconnect
+ " -d %d" % self.dom
+ " -p %d" % device_channel['port1']
+ " -m %s" % memory)
if args:
cmdline += " " + args
ramdisk = sxp.child_value(image, "ramdisk", '')
+ log.debug("creating plan9 domain with cmdline: %s" %(cmdline,))
vm.create_domain("plan9", kernel, ramdisk, cmdline)
return vm
memmap = sxp.parse(open(memmap))[0]
from xen.util.memmap import memmap_parse
memmap = memmap_parse(memmap)
+ log.debug("creating vmx domain with cmdline: %s" %(cmdline,))
vm.create_domain("vmx", kernel, ramdisk, cmdline, memmap)
return vm
return None
def spawn_vnc(display):
- os.system("vncviewer -listen %d &" % display)
+ os.system("vncviewer -log *:stdout:0 -listen %d &" %
+ (VNC_BASE_PORT + display))
return VNC_BASE_PORT + display
def preprocess_vnc(opts, vals):